package cate.common.table.item.furniture.sheet;

import cate.common.table.ESheet;
import cate.common.table.item.furniture.row.FurnitureLevelUpRow;

public class FurnitureLevelUpSheet extends ESheet<FurnitureLevelUpRow> {
    @Override
    public String getSheetName() {
        return "手办强化";
    }

    public FurnitureLevelUpRow findRow(int protoId, int level) {
        return getList().stream().filter(e -> e.protoId == protoId && e.level == level).findAny().orElse(null);
    }

    public int findCostNum(int protoId, int level) {
        return getList().stream().filter(e -> e.protoId == protoId && e.level < level).mapToInt(e -> e.costNum).sum();
    }
}
